{% extends 'base.html' %}
{% load static %}
{% block 'title' %}主页{% endblock%}
{% block 'content' %}
    <div class="container">
        <h1>立即购买！{% include 'widget-search.html'%}</h1>
        <p></p>
        
        <div class="table-responsive">
            <table class="table  table-hover">
                <thead >
                    <tr>
                        <th>#</th>
                        <th>名称</th>
                        <th>价格</th>
                        <th>购物车</th>
                    </tr>
                </thead>
                <tbody>
                    {% for item in paginator %}
                    <tr>
                        <td>{{forloop.counter0|add:paginator.start_index}}</td>
                        <td><a href="{% url 'show' item.pk %}">{{item.title}}</a></td>
                        <td>${{item.price}}</td>
                        <td><a href="{% url 'add' item.pk %}">添加</a></td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
            {% include 'widget-paginator.html' %}
        </div>
    </div>
{% endblock %}